package com.lagou.component;

import com.lagou.service.HelloService;
import com.lagou.service.MethodService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

@Component
public class ConsumerComponent {
    //注入的是分布式的远程服务的对象
//    @Reference(loadbalance = "consistanthash")
 /*  @Reference
    private HelloService helloService;

    public String sayHello(String name){
        return helloService.sayHello(name);
    }
*/
    @Reference
    private MethodService methodService;

    public String methodA(String name,Integer timeToWait){
        return methodService.methodA(name,timeToWait);
    }
    public String methodB(String name,Integer timeToWait){
        return methodService.methodB(name,timeToWait);
    }
    public String methodC(String name,Integer timeToWait){
        return methodService.methodC(name,timeToWait);
    }
}
